var fs=require('fs');
var zlib=require('zlib');


/**
 * 压缩
 *   转换流
 * */
/*fs.createReadStream('./file/input.txt')
  .pipe(zlib.createGzip())
  .pipe(fs.createWriteStream('./file/input.txt.gz'));*/

/**
 * 解压缩
 *    转换流
 * */
fs.createReadStream('./file/input.txt.gz')
    .pipe(zlib.createGunzip())
    .pipe(fs.createWriteStream('./file/inputp.txt'));